open(IN, "wyniiEks.300-614.txt");
open(FH, ">poprawioneWyn.txt");

$i = 300;

while($a = <IN>) {
	print FH $a;
	if ($a =~ /Wykonano iteracji:/) {
		$a = <IN>;
		print FH $a;
		
		$a = <IN>;
		$a =~ / ([-+]?\b[0-9]*\.?[0-9]+\b)/;
		$test = $1;
		print FH "[1] \"$i\"\n";
		print FH "[1] Numer testu:\n";
		print FH "[1] $i\n";
		print FH "[1] Numer funkcji:\n";
		print FH "[1] $test\n";
		$i++;
	}
}
# for($i = 300; $i < 615; $i++) {
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;

	# $a = <IN>;
	# print FH "[1] \"$i\"";
	# $i++;

	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
	# $a = <IN>;
	# print FH $a;
# }

close FH;
close IN;